/*var dns = require('dns');
const { createServer } = require('http');

dns.lookup('www.bilibili.com', {all:true},function(err, addresss, family){
	if(err) throw err;
	for(let address of addresss){ 
		console.log(address)
	}
});

 dns.resolve4('www.qq.com', function(err, address, family){
	if(err) throw err;
	console.log('配置host后2，dns.resolve4 =>' + address+"==="+family);
}); 
 
*/

var server = require('dns-express')();
 
server.a(/www.baidu.com/, function (req, res, next) {
    //Add an A record to the response's answer.
	console.log("aaa")
    res.a({
        name : req.name
        , address : '1.2.3.4'
        , ttl : 600
    })
 
    return res.end();
});
 
server.use(function (req, res) {
    //End the response if no "routes" are matched
    res.end();
});
 
server.listen(53535)
